#pragma once
#include <windows.h>

template <class Single>
class Singleton
{
private:
	static Single* Instance;

protected:
	Singleton();
	virtual ~Singleton();

public:
	static Single* GetInstance()
	{
		if( Instance == NULL )
		{
			Instance = new Single;
		}
		return Instance;
	}

	static void Release()
	{
		if( Instance != NULL )
		{
			delete Instance;
			Instance = NULL;
		}
	}
};
template <class Single>
Single* Singleton<Single>::Instance = NULL;

template <class Single>
Singleton<Single>::Singleton()
{
}

template <class Single>
Singleton<Single>::~Singleton()
{
}